package dao

import (
	"gitee.com/wao520/obtain_data/global"
	"gitee.com/wao520/obtain_data/model"
)

// select一条记录
func SelectOneArticle(articleId uint64) (*model.Article, error) {
	fields := []string{"articleId", "subject", "url"}
	articleOne := &model.Article{}
	err := global.DBLink.Select(fields).Where("articleId=?", articleId).First(&articleOne).Error
	if err != nil {
		return nil, err
	} else {
		return articleOne, nil
	}
}
